import 'package:sow_app_core/src/usecase/library_usecase.dart';
import 'package:sow_app_core/src/usecase/usecase.dart';
import 'package:test/test.dart';

import 'package:sow_app_mock/sow_app_mock.dart';

void main() {
  group('library usecase test group', () {
    test(
      "should return novelList  when call LibraryGetNovelListUseCase() with empty param ",
      () async {
        // arrange
        final presenter = MockLibraryPresenter();
        // act
        await LibraryGetNovelListUseCase(presenter, MockNovelRepository())(
            NoParams());
        await Future.doWhile(() => presenter.flag = false);
        // assert

        expect(presenter.recommendRank, isNotEmpty);
        expect(presenter.endBookRank, isNotEmpty);
        expect(presenter.hotRank, isNotEmpty);
        expect(presenter.hignScore, isNotEmpty);
        expect(presenter.newCome, isNotEmpty);
        expect(presenter.hotUp, isNotEmpty);
        expect(presenter.guessYouLike, isNotEmpty);
      },
    );
  });
}
